package com.quwan.manager.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.quwan.common.result.PageResult;
import com.quwan.entity.TSecurityAuditLog;
import com.quwan.manager.service.SecurityAuditLogService;
import com.quwan.mapper.TSecurityAuditLogMapper;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * @author laozhang
 * @date 2022/1/4 17:03
 */
@Service
@RequiredArgsConstructor
public class SecurityAuditLogServiceImpl implements SecurityAuditLogService {

    private final TSecurityAuditLogMapper securityAuditLogMapper;
    @Override
    public PageResult<TSecurityAuditLog> getSecurityAuditLogListPage(int page, int size, Integer type, String mobile,String id) {
        Page<TSecurityAuditLog> pageLog = securityAuditLogMapper.selectSecurityAuditLogList(new Page<>(page, size),type,mobile,id);

        PageResult<TSecurityAuditLog> result = new PageResult<TSecurityAuditLog>()
                .setCurrent(pageLog.getCurrent())
                .setPages(pageLog.getPages())
                .setSize(pageLog.getSize())
                .setTotal(pageLog.getTotal())
                .setRecords(pageLog.getRecords());
        return result;
    }
}
